package com.bsoft.mvpmy.ui.fastdi;

import com.bsoft.mvpmy.model.RequestBean.FastParams;
import com.bsoft.mvpmy.api.SimpleMyCallBack;
import com.bsoft.mvpmy.base.BaseCommonPresenter;
import com.bsoft.mvpmy.model.ResultBean.FastDi;
import com.bsoft.mvpmy.model.HttpExceptionBean;
import com.bsoft.mvpmy.utils.ToastUtils;

import rx.Subscription;

/**
 * User: ZRJ
 * Date: 2016/12/1
 * Email: 471564517@qq.com
 * Description:
 */
public class FastdiPresenter extends BaseCommonPresenter<FastDiContract.View> implements FastDiContract.Presenter {
    public FastdiPresenter(FastDiContract.View view) {
        super(view);
    }

    @Override
    public void fastdidata() {
       FastParams fastParams = new FastParams("d907ae8b729b72cbc25bbe3e641fc231");
        Subscription subscription = apiImple.getFastdiInfo(fastParams).subscribe(newMySubscriber(new SimpleMyCallBack<FastDi>() {
            @Override
            public void onError(HttpExceptionBean mHttpExceptionBean) {
                super.onError(mHttpExceptionBean);
            }

            @Override
            public void onNext(FastDi fastDi) {
                ToastUtils.showToast("查询成功l");
                view.fastdiSuccess(fastDi);
            }
        }));
        mCompositeSubscription.add(subscription);

    }
}
